/* util */
import http from '@src/util/http'
/* model */
import { SmsAutograph, SmsSupplierEnum } from '@model/biz/SMS'
import Result from '@model/Result'
import { QualificationStateEnum } from '@src/modules/setting/messageChannel/components/qualification/model/enum'
import { GetQualificationData, SaveQualificationRequest } from '@src/modules/setting/messageChannel/components/qualification/model/type'
import { GetQualificationStateResult } from '@model/param/out/Message'

/** 
 * @description 获取短信签名
 */
export function getSmsAutograph(): Promise<Result<SmsAutograph>> {
  return http.get('/api/message/outside/msg/config/getSmsAutograph') as Promise<Result<SmsAutograph>>
}

/** 
 * @description 获取短信供应商
 */
export function getSmsSupplier(): Promise<Result<SmsSupplierEnum>> {
  return http.get('/api/message/outside/msg/config/getSmsSupplier') as Promise<Result<SmsSupplierEnum>>
}

/**
 * @description 获取资质认证信息
 */
export function getQualificationState(): Promise<Result<GetQualificationStateResult>> {
  return http.get('/api/message/outside/sms/qualification/getQualificationState') as Promise<Result<GetQualificationStateResult>>
}

/**
 * @description 获取资质认证数据
 */
export function getQualificationData(): Promise<Result<GetQualificationData>> {
  return http.get('/api/message/outside/sms/qualification/getData') as Promise<Result<GetQualificationData>>
}

/**
 * @description 保存资质认证数据
 */
export function saveQualificationData(params: SaveQualificationRequest): Promise<Result<void>> {
  return http.post('/api/message/outside/sms/qualification/save', params) as Promise<Result<void>>
}
